package com.jueling.culture.controller;


import com.jueling.culture.core.Result;
import com.jueling.culture.core.ResultGenerator;
import com.jueling.culture.model.AuthorityInfo;
import com.jueling.culture.service.AuthorityInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
* @author linp
* @date 2022/02/18
*/
@RestController
@RequestMapping("/api/authority")
public class AuthorityInfoController {

    @Autowired
    private AuthorityInfoService authorityInfoService;

    /**
     * 获取权限集合
     * @return
     */
    @GetMapping
    public Result list() {
        List<AuthorityInfo> list = authorityInfoService.queryAuthorityInfoList();
        return ResultGenerator.genSuccessResult(AuthorityInfo.parseTree(list));
    }

}
